package cn.xhy.material.dal.mysql.specifications;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.xhy.material.controller.admin.specifications.vo.SpecificationsPageReqVO;
import cn.xhy.material.dal.dataobject.specifications.SpecificationsDO;
import org.apache.ibatis.annotations.Mapper;


/**
 * 规格 Mapper
 *
 * @author xhy
 */
@Mapper
public interface SpecificationsMapper extends BaseMapperX<SpecificationsDO> {

    default PageResult<SpecificationsDO> selectPage(SpecificationsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SpecificationsDO>()
                .eqIfPresent(SpecificationsDO::getSpecif, reqVO.getSpecif())
                .eqIfPresent(SpecificationsDO::getType, reqVO.getType())
                .betweenIfPresent(SpecificationsDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SpecificationsDO::getId));
    }

}
